package top.anydata.lifeofcode.lifesystem.entity.app.user;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * 功能描述:
 *
 * @author <a href="mailto:caingao@anydata.top">CainGao</a>
 * @version V_1.0
 * @date 2024/5/8 2:49 PM
 */
@Data
@Entity
@Table(name = "t_app_user", schema = "life_system_app", catalog = "")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppUserEntity {

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private Long id;
    @Basic
    @Column(name = "appid")
    private String appid;
    @Basic
    @Column(name = "user_name")
    private String userName;
    @Basic
    @Column(name = "pass_word")
    private String password;
    @Basic
    @Column(name = "phone_num")
    private String phoneNum;
    @Basic
    @Column(name = "avatar_url")
    private String avatarUrl;
    @Basic
    @Column(name = "gender")
    private Byte gender;
    @Basic
    @Column(name = "birth_day")
    private Timestamp birthDay;
    @Basic
    @Column(name = "registration_time")
    private Timestamp registrationTime;
    @Basic
    @Column(name = "is_ban")
    private Byte isBan;
    @Basic
    @Column(name = "status")
    private Byte status;

    @Override
    public int hashCode() {
        return Objects.hash(
                id,
                appid,
                userName,
                password,
                phoneNum,
                avatarUrl,
                gender,
                birthDay,
                registrationTime,
                isBan,
                status
        );
    }

}
